import Vue from 'vue'
import Router from 'vue-router'
import { Header, Swipe, SwipeItem } from 'mint-ui'


Vue.use(Router)

//引入指定模块
import Home from '@/components/home.vue'
import Member from '@/components/member.vue'
import Cart from '@/components/cart.vue'
import Search from '@/components/search.vue'
import NewsList from '@/components/news/NewsList.vue'
import NewslistInfo from '@/components/news/NewslistInfo.vue'

export default new Router({
  //设置路由规则
  routes: [
    {
      //path与to必须一致
      path: '/',
      redirect: Home
    },
    {
      path: '/home',
      component: Home
    },
    {
      path: '/member',
      component: Member
    },
    {
      path: '/cart',
      component: Cart
    },
    {
      path: '/search',
      component: Search
    },
    {
      path: '/home/newslist',
      component: NewsList
    },
    {
      path: '/newslistInfo/:id',
      component: NewslistInfo
    }
  ],
  //设置路由被激活时自动添加的类名,默认为router-link-active
  linkActiveClass: 'mui-active'
})
